<?php
namespace Admin\Model;
use Org\Util\String;
use Think\Model;
	class AdminModel extends Model{
		
		protected $_auto=array(
			array('created_at','time'),
		);

		public function update_pwd(){
			
			$salt = String::randString(10);
			$data['salt'] = $salt;
			$data['password'] = md5($_POST['password'].$salt);
			$count = $this-> where('id='.$_POST['id'])->setField($data);
			return $count;
		}
		
		protected $_validate = array(
		     array('username','','此账号已经存在！',0,'unique',3), // 在新增的时候验证name字段是否唯一
		 );
	    
	}
?>
